package com.ky.gp.app.controller;

import com.ky.common.param.OrderAdd;
import com.ky.common.vo.R;
import com.ky.gp.app.service.OrderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * --- 天道酬勤 ---
 *
 * @author ZhaoTongTong
 * @date 2024/6/18
 * @desc -- 代码敲烂 月薪过万--
 */
@RestController
@RequestMapping("/api/order")
public class OrderController {
    @Autowired
    private OrderFeign orderFeign;
    @RequestMapping("/findAllOrders")
    public R findAllOrders() {
        return orderFeign.findAllOrders() ;
    }
    @RequestMapping("/findAllOrderByType")
    public R findAllOrders(@RequestParam(value = "status")Integer status) {
        return orderFeign.findAllOrders1(status) ;
    }



    @RequestMapping("/createOrder")
    public R createOrder(@RequestBody OrderAdd orderAdd){
        return orderFeign.createOrder(orderAdd);
    }
}
